package acwing.prefixSumAndDifferenceArray;

import java.util.Scanner;

public class differenceArray {
    static int N = 100010;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[N];
        int[] b = new int[N];
        for (int i = 1; i <= n; i++) {
            // 初始化arr
            arr[i] = sc.nextInt();
            // 初始化b
            b[i] = arr[i] - arr[i - 1];
        }
        while (m-- != 0){
            int l = sc.nextInt();
            int r = sc.nextInt();
            int c = sc.nextInt();
            b[l] += c;
            b[r + 1] -= c;
        }
        for (int i = 1; i <= n; i++) {
            arr[i] = arr[i - 1] + b[i];
            System.out.print(arr[i] + " ");
        }
    }
}
